package com.xywy.beautyand.bean;

import android.app.Activity;
import android.content.Context;
import android.content.SharedPreferences;

/**
 * *****************************************
 * 
 * @Title: User.java
 * @Package com.xywy.bloodandroid.bean
 * @Description: TODO(用户信息存在本地)
 * @author smz
 * @date 2014-12-23 上午11:08:10
 * @version V1.0
 ******************************************* 
 */
public class User  extends BaseHttpResponse{

	private static User user = null;
	private int state;
	private String userid;
	private String isregister;
	private String phonenum;
	private String height;
	private String sex;
	private String birthday;
	private String accountstr;
	private static SharedPreferences sp;// 将登录信息存到文件中

	public static User getInstance(Context context) {
		if (user == null) {
			user = new User();
		}
		sp = context.getSharedPreferences("xywy_beauty_info.pre",
				Activity.MODE_PRIVATE);
		return user;
	}

	public int getState() {
		return sp.getInt("state", -1);
	}

	public void setState(int state) {
		sp.edit().putInt("state", state).commit();
	}

	public String getUserid() {
		return sp.getString("userid", "");
	}

	public void setUserid(String userid) {
		sp.edit().putString("userid", userid).commit();
	}

	public String getIsregister() {
		return sp.getString("isregister", "");
	}

	public void setIsregister(String isregister) {
		sp.edit().putString("isregister", isregister).commit();
	}

	public String getPhonenum() {
		return sp.getString("phonenum", "");
	}

	public void setPhonenum(String phonenum) {
		sp.edit().putString("phonenum", phonenum).commit();
	}

	public String getHeight() {
		return sp.getString("height", "");
	}

	public void setHeight(String height) {
		sp.edit().putString("height", height).commit();
	}

	public String getSex() {
		return sp.getString("sex", "");
	}

	public void setSex(String sex) {
		sp.edit().putString("sex", sex).commit();
	}

	public String getBirthday() {
		return sp.getString("birthday", "");
	}

	public void setBirthday(String birthday) {
		sp.edit().putString("birthday", birthday).commit();
	}

	public String getAccountstr() {
		return sp.getString("accountstr", "");
	}

	public void setAccountstr(String accountstr) {
		sp.edit().putString("accountstr", accountstr).commit();
	}

}
